package it.polimi.traveldream.ejb.entities;

import java.io.Serializable;

import javax.persistence.*;

import java.sql.Timestamp;
import java.util.Date;


/**
 * The persistent class for the composedpredefinedpackage database table.
 * 
 */
@Entity
@NamedQuery(name="Composedpredefinedpackage.findAll", query="SELECT c FROM Composedpredefinedpackage c")
public class Composedpredefinedpackage implements Serializable {
	private static final long serialVersionUID = 8541285484477167297L;
	private int predefinedPackage;
	private Timestamp timestamp;
	private Travelpackage travelpackage;
	private User user;

	public Composedpredefinedpackage() {
		super();
	}

	public Composedpredefinedpackage(Timestamp timestamp,
			Travelpackage travelpackage, User user) {
		super();
		this.timestamp = new Timestamp(new Date().getTime());
		this.travelpackage = travelpackage;
		this.user = user;
	}


	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(insertable=false, updatable=false)
	public int getPredefinedPackage() {
		return this.predefinedPackage;
	}

	public void setPredefinedPackage(int predefinedPackage) {
		this.predefinedPackage = predefinedPackage;
	}

	public Timestamp getTimestamp() {
		return this.timestamp;
	}

	public void setTimestamp(Timestamp timestamp) {
		this.timestamp = timestamp;
	}


	//bi-directional one-to-one association to Travelpackage
	@OneToOne
	@JoinColumn(name="PredefinedPackage")
	public Travelpackage getTravelpackage() {
		return this.travelpackage;
	}

	public void setTravelpackage(Travelpackage travelpackage) {
		this.travelpackage = travelpackage;
	}


	//bi-directional many-to-one association to User
	@ManyToOne
	@JoinColumn(name="Employee")
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

}